New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make anyone can register block syncer code to the Glueby::BlockSyncer #66
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to this change, following change are required:
- remove
wallet_adaptor.rake
. This is same withActiveRecordWalletAdapter::Syncer
, right? - need to migrate
timestam.rake
.
It is almost the same but ActiveRecordWalletAdapter::Syncer is not a rake task. |
You mean glueby:contract:timestamp:confirm should be abrogated and the confirmation should be checked as a block syncer logic. |
7c3171f
to
553542d
Compare
|
f6834bd
to
6d64df9
Compare
I've updated all the above things. |
lib/glueby.rb
Outdated
@@ -1,6 +1,12 @@ | |||
require "glueby/version" | |||
require 'tapyrus' | |||
|
|||
begin | |||
require 'rails' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why require rails
? It doesn't seem to be defined in the gemspec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that it is necessary if glueby is loaded in a rails project. Glueby needs to use Rails::Railtie module. However, I didn't confirm whether it causes some error or not. I will check it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed these codes. There is no error if it is removed.
To be referred from other module and etc.
We can use glueby:block_syncer:start
Glueby::Internal::Wallet#broadcast(tx) changes the txid of tx in arguments while using FeeProvider. If it store a txid before broadcasting, the txid would be changed. Here the method can receive a code block which is called before actual broadcasting and caller can execute some codes with real tx that is going to be broadcasted.
6d64df9
to
d564762
Compare
See the example code in class document here